import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: require('@/view/Index').default,
      children: [
        {
          path: 'system',
          name: 'system',
          component: require('@/view/system/System').default,
          children: [
            {
              path: 'org',
              name: 'org',
              component: require('@/view/system/org/Org').default
            },
            {
              path: 'user',
              name: 'user',
              component: require('@/view/system/user/User').default
            },
            {
              path: 'role',
              name: 'role',
              component: require('@/view/system/System').default
            }
          ]
        },
        {
          path: 'redis',
          name: 'redis',
          component: require('@/view/redis/Redis').default,
          children: [
            {
              path: 'org',
              name: 'org',
              component: require('@/view/system/org/Org').default
            }
          ]
        }
      ]
    },
    {
      path: '/landing',
      name: 'landing-page',
      component: require('@/components/LandingPage').default
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})
